const axios = require('axios');
module.exports = {
    namespaced: true,
    state:{
        admlist:[],
    },
    mutations:{
        getclasses(state,data){
            state.admlist = data
        }
    },
    actions:{
        async addadmAsync(context,name){ 
            const { data } = await axios.post("adm/addAdm",name)
            console.log( data );
        },
        async getadmAsync(context){
            const { data } = await axios.get("adm/getAdm");
            context.commit('getclasses', data); 
        },
        //删除管理员
        async deleteadmAsync(context,row){
            const { data } = await axios.post("adm/deleteAdm",row);
            console.log(data);
             
        },
        //修改管理员
        async updateadmAsync(context,row){
            const { data } = await axios.post("adm/updateAdm",row);
            console.log(data);
             
        }
    },
}